package BasicGrammar;

public class day_0923_类和对象  {
//    public class dog{
//        public String name;
//        public int age;
//        public dog(String name,int age){
//            this.name=name;
//            this.age=age;
//        }
//    }
//
//
static class Person {

    public String name;
    public int age;

    public Person(String name) {
        this.name = name;
    }

    public Person() {
    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public static void main(String[] args) {

        Person person1 = new Person();
        person1.name = "zhangsan";
        person1.age = 10;
        System.out.println(person1.name);
        System.out.println(person1.age);


        System.out.println("===========================");
        Person person2 = new Person("zhangfei");
        person2.age = 10;
        System.out.println(person2.name);
        System.out.println(person2.age);


        System.out.println("===========================");
        Person person3 = new Person("lisi", 9);
        System.out.println(person3.name);
        System.out.println(person3.age);
    }
}

}

